Check out my twitter script by CMXads
Sell your soul Believeth in me an hath everlasting life | Sharp Stuff Switchblades Icepicks and german knives | Viking gear Gear Gifts and Apparel | Till death do us part Axels New Music releases |
here are some of the best and useful php scripts and snippets to help in your projects. Php displayed below. Use the search for specific script lookups. Click the category links to view scripts in Javascript and cgi. To add your own script click the link and add your useful script example.
Ways to regulate data and limit using a timestamp comparision
compare regulate by time timestamp
compare-timestamps date added Jan 2013
<?php
function time_is_older_than($t, $check_time){
$t = strt
olower($t);
$time_type = substr(preg_replace('/[^a-z]/', '', $t),
0, 1);
$val = intval(preg_replace('/[^0-9]/', '', $t));
$ts
= 0;
// (s)econds, (m)inutes, (d)ays, (y)ears
if ($time_
type == 's'){ $ts = $val; }
else if ($time_type == 'm'){ $ts = $v
al * 60; }
else if ($time_type == 'h'){ $ts = $val * 60 * 60; }
else if ($time_type == 'd'){ $ts = $val * 60 * 60 * 24; }
els
e if ($time_type == 'y'){ $ts = $val * 60 * 60 * 24 * 365; }
else
{ die('Unknown time format given!'); }
if ($check_time < (tim
e()-$ts)){ return true; }
return false;
}
?>